<?php
include '../conn.php';
if(!isset($_GET['notice_id'])){
    $arr = [
        "desc" => "缺少参数"
    ];
    echo json_encode($arr);
    exit;
}
$notice_id = $_GET['notice_id'];

$sql = "select a.id,b.nickname,b.avatar,a.title,a.content,a.update_time from users_content as a
        left join users_info as b
        on a.user_id = b.id
        where a.id = $notice_id
        limit 1";
$res = $pdo->getOne($sql);
$arr = array();
array_push(
    $arr,[
        "id" => $res['id'],
        "nickname" => "$res[nickname]",
        "avatar" => "$url$res[avatar]",
        "title" => "$res[title]",
        "content" => "$res[content]",
        "time" => "$res[update_time]"
    ]
);
echo json_encode($arr);
exit;